package com.duobeiyun.gmstest.work

import android.content.Context
import android.util.Log
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
import com.duobeiyun.gmstest.TestInstance
import com.duobeiyun.gmstest.log.LogOuter
import com.duobeiyun.gmstest.work.sample.WorkAsyncMode
import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.suspendCancellableCoroutine
import java.util.*
import kotlin.coroutines.resume

/**
 * 测试取消订阅用户在线状态
 */
class WorkUnsubscribePeerOnLineStatus(appContext: Context, workerParams: WorkerParameters) :
        WorkAsyncMode(appContext, workerParams) {
    override fun setNumber() {
        TAG = "WorkPeerOnLineStatus"
        number = "3"
    }
    override fun realWork(continuation: CancellableContinuation<Result>) {

        TestInstance.unsubscribePeersOnlineStatus(TestInstance.onLineSet)
        LogOuter.print("number:$number \t result:${true} \t name:unPeerOnLineStatus ")
        continuation.resume(Result.success())
    }


}